<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input id="btn" type="button" value="刷新">
		<input id="goToGoal" type="button" value="百度">
		<script>
			// 1.刷新方法
			var btn = document.getElementById('btn');
			btn.onclick = function() {
				location.reload();
			}
			// 获取url信息
			var url = location.href;
			alert(url);


			//访问指定网站
			var gtg = document.getElementById('goToGoal');
			gtg.onclick = function() {
				location.href = "https://www.baidu.com";

			}
		</script>
	</body>
</html>
